home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / sun / print / PrintJob2D$MessageQ.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  1.1 KB  |  69 lines

  1. package sun.print;
  2.  
  3. import java.awt.Graphics2D;
  4. import java.util.ArrayList;
  5.  
  6. class PrintJob2D$MessageQ {
  7.    private String qid;
  8.    private ArrayList queue;
  9.    // $FF: synthetic field
  10.    final PrintJob2D this$0;
  11.  
  12.    PrintJob2D$MessageQ(PrintJob2D var1, String var2) {
  13.       this.this$0 = var1;
  14.       this.qid = "noname";
  15.       this.queue = new ArrayList();
  16.       this.qid = var2;
  17.    }
  18.  
  19.    synchronized void closeWhenEmpty() {
  20.       while(this.queue != null && this.queue.size() > 0) {
  21.          try {
  22.             this.wait(1000L);
  23.          } catch (InterruptedException var2) {
  24.          }
  25.       }
  26.  
  27.       this.queue = null;
  28.       this.notifyAll();
  29.    }
  30.  
  31.    synchronized void close() {
  32.       this.queue = null;
  33.       this.notifyAll();
  34.    }
  35.  
  36.    synchronized boolean append(Graphics2D var1) {
  37.       boolean var2 = false;
  38.       if (this.queue != null) {
  39.          this.queue.add(var1);
  40.          var2 = true;
  41.          this.notify();
  42.       }
  43.  
  44.       return var2;
  45.    }
  46.  
  47.    synchronized Graphics2D pop() {
  48.       Graphics2D var1 = null;
  49.  
  50.       while(var1 == null && this.queue != null) {
  51.          if (this.queue.size() > 0) {
  52.             var1 = (Graphics2D)this.queue.remove(0);
  53.             this.notify();
  54.          } else {
  55.             try {
  56.                this.wait(2000L);
  57.             } catch (InterruptedException var3) {
  58.             }
  59.          }
  60.       }
  61.  
  62.       return var1;
  63.    }
  64.  
  65.    synchronized boolean isClosed() {
  66.       return this.queue == null;
  67.    }
  68. }
  69.